package com.sxt.action;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.sxt.entity.UserInfo;
import com.sxt.service.CityService;
import com.sxt.service.UserService;

@SuppressWarnings("serial")
public class UserAction extends ActionSupport {

	private UserService uservice;
	private CityService cservice;
	private List ulist;//����
	private UserInfo user;
	
	
	public void setCservice(CityService cservice) {
		this.cservice = cservice;
	}

	public UserInfo getUser() {
		return user;
	}

	public void setUser(UserInfo user) {
		this.user = user;
	}

	public List getUlist() {
		return ulist;
	}

	public void setUlist(List ulist) {
		this.ulist = ulist;
	}

	public void setUservice(UserService uservice) {
		this.uservice = uservice;
	}

	public String list() throws Exception {
		// TODO Auto-generated method stub
		ulist=uservice.getUsers();
		return "list";
	}
	public String add() throws Exception {
		// TODO Auto-generated method stub
		uservice.addUser(user);
		return SUCCESS;
	}
	public String preAdd() throws Exception {
		// TODO Auto-generated method stub
		ulist=cservice.getCitys();
		return "add";
	}
}
